﻿using Ceri.Platform.Common.Model.CLMS.BASEINFO;
using Ceri.Platform.EAM_NEW.API.IRepository.Base;
using Ceri.Platform.EAM_NEW.API.Services.BASE.Impl;
using Microsoft.Extensions.Logging;
using System;

namespace Ceri.Platform.EAM_NEW.API.Services.BasicData.Impl
{
    public class CRANEServiceImpl : BaseServices<CRANE>, ICRANEService
    {
        public CRANEServiceImpl(ILogger<CRANE> _logger, IBaseRepository<CRANE> BaseDal = null) : base(_logger, BaseDal)
        {
        }

        public bool LogTest()
        {
            //message为表中的LOG_MESSAGE
            _logger.Log(LogLevel.Debug, $"Debug");
            _logger.Log(LogLevel.Information, $"Info");
            try
            {
                throw new Exception($"异常");
            }
            catch (Exception ex)
            {
                _logger.Log(LogLevel.Error, ex, $"异常的附加信息");
            }
            return false;
        }
    }
}
